package com.pers.springcloud.service;

import com.pers.springcloud.entities.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: 黄建
 * @Date: 2020/3/8 21:54
 */
@Component
//value：在Eureka注册中心的服务名称
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    //将CLOUD-PAYMENT-SERVICE的api方法拷贝过来，定义一个接口
    @GetMapping(value = "/payment/get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public JSONResult getPayment(@PathVariable(value = "id") Long id);

}
